
import React, { Component } from 'react';
// 引入路由
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
// 引入路由组件



class Category extends Component {

    constructor(props) {
        super(props)
        this.state = {}
    }
    render() {
        return (
            <Router>
                <div className="category">
                    <ul className="category-ul">
                        <li><Link to="/category/">精选</Link></li>
                        <li><Link to="/category/ai">人工智能</Link></li>
                        <li><Link to="/category/cloud">云计算基础</Link></li>
                        <li><Link to="/category/things">物联网</Link></li>
                    </ul>
                    <div className="right-view">
                        {/* <Route exact path="/category/" component={Handpick} />
                        <Route path="/category/ai" component={Ai} />
                        <Route path="/category/cloud" component={Cloud} />
                        <Route path="/category/things" component={Things} /> */}
                        {
                            this.props.routes.map((route,key)=>{
                                return <Route key={key} exact path={route.path} component={route.component} />
                            })
                        }
                    </div>
                </div>
            </Router>

        )
    }
}
export default Category;